<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>MackDown在线管理</title>
<style type="text/css">
*{margin:0;padding: 0}
.main{height: 500px;width: 80%;margin:5% auto auto auto;background: #ccc;position: relative;}
#box{height: 200px;width: 500px;background: #f00;margin: 0;display: none}
#box ul{padding: 0;margin: 0}
#box ul li{list-style: none;}
.new {position: relative;cursor: pointer}
.new:hover+.new_item{display: block}
.new_item:hover{display: block}
.new_item{height: 100px;width: 100px;background: #f00;position: absolute;top:20px;display: none;cursor:pointer;}
</style>
</head>
<body>
<script src="jquery.min.js"></script>
<script src="./common/function.js"></script>
<script type="text/javascript">
	 window.onload = function () { 		
		function eachJson(obj){
			if(obj.constructor==Array){
				var str="<ul>";
					for (var i = 0, len = obj.length; i < len; i++) {
					    var time=timestampToTime(eachJson(obj[i].addtime));
						//var status=coverStatus(eachJson(obj[i].status));
						// str += "<li>"+eachJson(obj[i].id)+status+"</li>";
						str += "<li>"+eachJson(obj[i].name)+time+"</li>";
					}
				str+="</ul>";
				return str;
			}
			return obj;
		}
	 	$.getJSON("php/conn.php", function(result){
         	if(result.status==1){
				 //alert(result.msg);
				 $.getJSON("php/returnfile.php",function(result){
					 console.log(result);
					$("#box").append(eachJson(result));
				 });
         	}else{
         		//alert('llllll');
         	}
        });
		$("#newfolder").click(function(){
			// alert('llalala');
			var str="<input type='text'/>";
			this.append(str);
		})
	 }
</script>
	<div class="main">
		<div class="header">
			<span class="new">新建</span>
				<div class="new_item">
					<span id="newfolder">新建文件夹</span>
					<span>新建文件</span>
				</div>
		</div>
		<div id="box"></div>
	</div>

</body>
</html>